home *** CD-ROM | disk | FTP | other *** search
- ***********************************************************************
- This article is being presented through the *StarBoard* Journal of the
- FlagShip/StarShip SIGs (Special Interest Groups) on Delphi and GEnie
- telecommunication networks. Permission is hereby granted to non-profit
- organizations only to reprint this article or pass it along electronic-
- ally as long as proper credit is given to both the author and the
- *StarBoard* Journal.
- ***********************************************************************
-
-
- The following discussion is an excerpt from the book,
- "How to Get the Most Out of GEOS, and is copyrighted
- (C) 1986 by the Midnite Press/Midnite Software Gazette,
- and MicroPACE Computers. Permission is hereby granted
- to non-profit groups to reprint this excerpt in its
- entirety, provided that The Midnite Software Gazette
- and Tim Sickbert are credited. For more information,
- please contact the Midnite Software Gazette at
- P.O. Box 1747
- Champaign, IL 61820
-
- or via E-Mail
- on Delphi: MIDNIT
- on Q-Link: The Paper
-
-
-
-
- ASCII vs PETSCII
-
- A big area of confusion exists around the differences that
- exist between ASCII and PETSCII.
-
- ASCII (American Standard Code for Information Interchange) is
- the standard code for micro-computers, and is used by MS DOS
- machines, CP/M machines, and others. True ASCII provides
- one hundred and twenty-eight codes, numbered 0-127, that
- represent characters. Control characters all have values from
- 0 to 31, punctuation and numerals have values from 32 through 63,
- upper case characters have values from 64 through 95, and lower
- case characters have values from 96 through 127.
-
- PETSCII is a variation of the ASCII code used by the
- Commodore PET and VIC series of computers. It was first used on
- the Commodore PET 2001, from which it got its name. PETSCII is
- also used on the VIC series of computers. (The VIC series
- includes the VIC 20, C64, and C128. The series draws its name
- from the Video Interface Chip, or VIC, chip, which is present in
- some form in these three computers.) PETSCII provides two
- hundred and fifty six codes, numbered 0-255, that represent
- characters. It is nearly identical with ASCII for values through
- 63. At values 64-95, however, PETSCII has lower case characters;
- from 96 through 191 it has graphics and reversed characters; from
- 192 through 218 it has upper case characters; and from 219
- through 255 it has more graphics characters.
-
- To further complicate matters, the Commodore 64 has two
- character sets. The default character set shows a lower case "a"
- as an upper case "A," and an upper case "A" as a graphic
- character that looks like a spade. Thus this is known as the
- uppercase/graphics character set, uppercase/graphics mode, or
- local cursor up mode. You may toggle into lowercase/uppercase,
- or local cursor down, mode by pressing the Commodore logo key
- (<logo>) and either of the <SHIFT> keys at the same time. A
- lower case "a" will then appear as an "a," and a <SHIFT>ed "a"
- will appear as "A."
-
- What appears on your screen as an "a" in lowercase/uppercase
- mode, or as an "A" in uppercase/graphics mode is represented in
- the computer as the value 65. You can check this by using the
- CHR$() function or the ASC() function. For example, in
- uppercase/graphics mode, enter the following commands:
-
- PRINT CHR$(65) and PRINT ASC("A")
-
- Now toggle between the uppercase/graphics and lowercase/uppercase
- using the <logo><SHIFT> combination. Now do the same with a
- <SHIFT>ed "A" and the value 193.
-
- To really confuse matters PRINT CHR$(97) in
- lowercase/uppercase mode. Another upper case "A!" But this is
- not really an "A." This is a graphics character in Character Set
- 2 that just looks like a real "A."
-
- Some programs, such as GEOS, use true ASCII. This will
- seldom be a problem, except when you use other programs for
- conversion or transmission over modem, such as the sequential
- file BUILD and UNBUILD programs in section two of How to Get the
- Most Out of GEOS. To show the trouble, we will use the directory
- from BASIC. First, load the directory of a GEOS disk from BASIC, or
- use a DOS wedge to list it.
-
- LOAD"$",8 <RETURN>
- wait for <READY> prompt
- LIST <RETURN>
- or
- @$ <RETURN>
- using the DOS Wedge.
-
- If you are in uppercase/graphics mode, the listing of the
- directory will have some upper case characters and many graphics.
- If you are in lowercase/uppercase mode, the directory will look
- something like:
-
- 0 "geos v1.2 " df 2a
- 1 "geos" prg<
- 6 "geos boot" prg<
- 85 "geos kernal" usr<
- 119 "geopaint" usr<
- 88 "geowrite" usr<
- 17 "NOTE PAD" usr
- 16 "backup" prg<
- 22 "PREFERENCE MGR" usr
- 23 "PHOTO MANAGER" usr
- 20 "TEXT MANAGER" usr
- .
- .
- .
-
- Now we are going to use a little known trick of the
- Commodore DOS. We can ask the disk drive if a certain file is on
- the disk. For example, in lowercase/uppercase mode:
-
- load "$:geos",8 <RETURN>
- wait for <READY> prompt, and
- list <RETURN>
- or
- @$:geos <RETURN>
-
- The computer will display a directory with only the "geos"
- file. You can do the same with "geos boot," "geos kernal,"
- "geopaint," "geowrite," and "backup." Now try the same thing
- using upper case letters on a file like "NOTE PAD" or "PREFERENCE
- MGR." You will get the first line of the directory and the
- number of blocks free, but no file names.
-
- This is because when you ask the disk drive to look for a
- file with the name "NOTE PAD," you are telling it to look for a
- file that has the codes
-
- [206,207,212,197,32,208,193,196]
-
- but the name of the file on disk has the codes
-
- [110,111,116,101,32,112,97,100].
-
- In lowercase/uppercase mode, the codes look the same. The
- BUILD program in section 2 compensates for this with the little
- routine at 1490. If this routine were not used, you would not be
- able to build a sequential file from a GEOS file unless you had
- used all upper case letters within GEOS for the file name. The
- trouble does not end there. The routine at 1490 just lets you
- find the file on disk. The BUILD program must give a name to the
- sequential file that it creates. If it used the same codes as
- the original name, your telecommunications program might never be
- able to find the program you want to send. The routine in lines
- 880)930 build a name that a terminal program can use for the new
- file. GEOS is able to handle PETSCII for filenames, so this will
- not cause a problem when you UNBUILD the file back into GEOS
- format.